#include "sock.hpp"
int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        cout << "format error" << endl;
        exit(6);
    }
    uint16_t port = atoi(argv[2]);
    string ip = argv[1];
    int sock = socket(AF_INET, SOCK_STREAM, 0);
    sockaddr_in sever;
    sever.sin_addr.s_addr = inet_addr(ip.c_str());
    sever.sin_family = AF_INET;
    sever.sin_port = htons(port);
    Sock::Connect(sock, &sever);
    char buffer[1000] = "dsadsdsadasd";
    while (true)
    {
        cout << buffer << endl;
        ssize_t s = send(sock, buffer, 1000, 0);
        cout << s << endl;
        break;
    }
    return 0;
}